import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo/core/api/all_request.dart';
import 'package:flutter_demo/core/router/router.dart';
import 'package:flutter_demo/core/store/meal_view_model.dart';
import 'package:flutter_demo/ui/shared/size_fit.dart';
import 'package:flutter_demo/ui/shared/theme.dart';
import 'package:provider/provider.dart';

main() {
  runApp(
    ChangeNotifierProvider(
      create: (ctx) => MealViewModel(),
      child: App(),
    )
  );
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SizeFit.init();
    return MaterialApp(
      title: "美食广场",

      theme: AppTheme.normalTheme,
      darkTheme: AppTheme.darkTheme,

      routes: AppRouter.routes,
      initialRoute: AppRouter.initRoute,
      onGenerateRoute: AppRouter.generateRoute,
      onUnknownRoute: AppRouter.unknownRoute,
    );
  }
}
